import { IResponse } from './../../axios/modules';
import { ajaxDel, ajaxGet, ajaxPut, ajaxUpload } from "@/http/axios/request"
import { IMenuNode } from "@/modules/management/menu"

export const getMenuList = (): Promise<IResponse<IMenuNode[]>> => {
    return ajaxGet('/admin/menu/listsNode')
}

export const addMenuNode = (data: IMenuNode) => {
    return ajaxUpload('/admin/menu/addNode', data)
}

export const updateMenuNode = (data: IMenuNode) => {
    return ajaxPut('/admin/menu/editNode', data)
}

export const delMenuNode = (data: { node_id: number }) => {
    return ajaxDel('/admin/menu/deleteNode', data)
}